package com.yoowin.test;

public class StringDisplay extends AbstractDisplay {

	private String str;
	private int width;

	@Override
	public void open() {
		printLine();
	}

	public StringDisplay(String str) {
		super();
		this.str = str;
	}

	@Override
	public void print() {
		System.out.println("|" + str + "|");
	}

	@Override
	public void close() {
		printLine();
	}

    public final void printLine()
    {
        System.out.println("+");

        for (int i = 0; i < width; i++)
        {
            System.out.println("-");
        }

        System.out.println("+");
    }
}
